#%RAML 1.0 Library
usage: |
  Defines Constraint types for new type definitions
uses:
  pragma: pragma.raml
types:
  ConstraintOperator:
    type: string
    enum: [UNIQUE, CLUSTER, GROUP_BY, LIKE, UNLIKE, MAX_PER, IS]
  Constraint:
    type: object
    properties:
      fieldName: string
      operator: ConstraintOperator
      value?: string
    examples:
      onePerAgent:
        fieldName: hostname
        operator: UNIQUE
  AppConstraint:
    description: |
      v2 App defined constraints as a 2 or 3 element array
      with [fieldName, ConstraintOperator(,value?)].
    type: array
    (pragma.omitEmpty):
    items: string
    minItems: 2
    maxItems: 3
    example: ["hostname", "UNIQUE"]
  VolumeConstraint:
    description: |
      Constrain which volume to choose on the agent.
      Currently, it is only possible to constrain the path of the disk resource by regular expression.
    type: array
    (pragma.omitEmpty):
    items: string
    minItems: 2
    maxItems: 3
